var Window02 = cc.Class.extend({
	scene: null,
	layer: null,
	flow: null,
	step: 1,
	tag: null,
	rootNode:null,
	closeButton: null,
	ctor:function (parent, flow, tag) {
		this.tag = tag;
		this.layer = parent;
		this.scene = parent.getParent();
		this.init();
	},
	init:function (){
		this.rootNode = new cc.NodeGrid();
		this.rootNode.setCascadeOpacityEnabled(true);
		this.rootNode.setOpacity(0);
		this.layer.addChild(this.rootNode, 99, this.tag);
		
		this.bg = new cc.Sprite("#lite.png");
		this.bg.setCascadeOpacityEnabled(true);
		this.bg.setPosition(gg.c_p);
		this.rootNode.addChild(this.bg, 0);
		
		this.closeButton = new Button(this.rootNode,
				10, TAG_WINDOW_CLOSE,
				"#button/close.png",
				this.callback,this);
		this.closeButton.setPosition(885, 550);
		this.initSp();
	},
	initSp:function (){
		// 初始化，自定义元素
	},
	open:function(){
		this.rootNode.runAction(cc.fadeIn(0.5));
	},
	close:function(){
		this.rootNode.runAction(cc.fadeOut(0.5));
	},
	destroy:function() {
		gg.synch_listener = true;
	},
	byTag:function(tag){
		return this.rootNode.getChildByTag(tag);
	},
	eventMenuCallback:function(pSender){
		this.step ++;
		if(gg.flow.flow.incast == TAG_WINDOW_CLOSE){
			if(gg.flow.flow.delay == NODELAY){
				this.close();
			} else {
				this.closeWin();				
			}
		}
		this.callbackSp(pSender);
	},
	callback:function(pSender){
		gg.flow.next();
		this.close();
	},
	callbackSp:function(){
		// 重写
	},
	closeWin:function(){
		this.step = 1;
		this.layer.scheduleOnce(this.close.bind(this), 1);
	}
})